package com.itbac.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author: BacHe
 * @email: 1218585258@qq.com
 * @Date: 2020/9/6 21:52
 */
@Configuration
public class AppConfig {
    //不支持ribbon
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

    @Bean
    @LoadBalanced //支持ribbon负载均衡, nacos-discovery里有ribbon的依赖。
    public RestTemplate restTemplateLoadBalanced(){
        return new RestTemplate();
    }
}
